<?php

	/*
	*	分页列表Model
	*	分页查询
	*/

	
	class OverviewModel {

	    private $table;

	    public function __construct() {

	        $this->table = new DataTableModel();

        }

	    public function getNumbers() {

            $numbers = $this->table->countRecords();

            if(!$numbers) {

                echo "<script>alert('get numbers error in overview model')</script>";

                return false;

            }

            return $numbers;

        }
		
		
		//	从数据库获取详情
		public function getDetail($limit, $offset) {
			
			$res = $this->table->pageSelect($limit, $offset);

			$i = 0;

			while($tmp = mysql_fetch_assoc($res)) {
				
				$result[$i++] = $tmp;
				
			}
			
			if(isset($result) && (!empty($result))) {
				
				return $result;
				
			} else {
				
				return false;
				
			}
		}
	}
?>